<%@ page pageEncoding="UTF-8" contentType="text/html"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib tagdir="/WEB-INF/tags" prefix="util" %>

<p>As a <b>${param.role}</b>, you may:
	<c:choose>
		<c:when test="${param.role=='InventoryManager'}">
			<util:order-action url="${pageContext.request.contextPath}/so_list" list="Ready To Pick" operation="Pick" role="InventoryManager" text="Pick SO" />
			<util:order-action url="${pageContext.request.contextPath}/so_list" list="Picked" operation="View" role="InventoryManager" text="View Picked SO" />
			<util:order-action url="${pageContext.request.contextPath}/po_list" list="Received" operation="Deliver" role="InventoryManager" text="Deliver PO" />
			<util:order-action url="${pageContext.request.contextPath}/po_list" list="Delivered" operation="View" role="InventoryManager" text="View Delivered PO" />
		</c:when>

		<c:when test="${param.role=='Manager'}">
			<util:order-action url="${pageContext.request.contextPath}/po_list" list="Waiting-for-Approval" operation="Approve" role="Manager" text="Approve/Reject PO" />
			<util:order-action url="${pageContext.request.contextPath}/po_list" list="Approved/Rejected" operation="View" role="Manager" text="View Approved/Rejected PO" />
			<form action="">
				<button type="submit" class="btn btn-default btn-block">Manage Users</button>
			</form>
		</c:when>

		<c:when test="${param.role=='PurchaseSpecialist'}">
			<form action="${pageContext.request.contextPath}/po_new">
				<button type="submit" class="btn btn-default btn-block">Create PO</button>
			</form>
			<util:order-action url="${pageContext.request.contextPath}/po_list" list="Rejected" operation="Renew" role="PurchaseSpecialist" text="Renew PO" />
			<util:order-action url="${pageContext.request.contextPath}/po_list" list="Waiting-for-Approval" operation="View" role="PurchaseSpecialist" text="View Waiting-for-Approval PO" />
			<util:order-action url="${pageContext.request.contextPath}/po_list" list="Cancellable" operation="Cancel" role="PurchaseSpecialist" text="Cancel PO" />
			<util:order-action url="${pageContext.request.contextPath}/po_list" list="Cancelled" operation="View" role="PurchaseSpecialist" text="View Cancelled PO" />
		</c:when>

		<c:when test="${param.role=='ShippingSpecialist'}">
			<util:order-action url="${pageContext.request.contextPath}/so_list" list="Picked" operation="Ship" role="ShippingSpecialist" text="Ship SO" />
			<util:order-action url="${pageContext.request.contextPath}/so_list" list="Shipped" operation="View" role="ShippingSpecialist" text="View Shipped SO" />
			<util:order-action url="${pageContext.request.contextPath}/po_list" list="Shipped" operation="Receive" role="ShippingSpecialist" text="Receive PO" />
			<util:order-action url="${pageContext.request.contextPath}/po_list" list="Received" operation="View" role="ShippingSpecialist" text="View Received PO" />
		</c:when>

		<c:when test="${param.role=='Retailer'}">
			<form action="${pageContext.request.contextPath}/browse">
				<button type="submit" class="btn btn-default btn-block">Browse Books</button>
			</form>
			<form action="${pageContext.request.contextPath}/shopping_cart">
				<button type="submit" class="btn btn-default btn-block">Show Shopping Cart</button>
			</form>
			<util:order-action url="${pageContext.request.contextPath}/so_list" list="Ready To Pick" operation="View" role="Retailer" text="View Read-To-Pick SO" />
		</c:when>

		<c:when test="${param.role=='ContentEditor'}">
			<form action="${pageContext.request.contextPath}/new_product">
				<button type="submit" class="btn btn-default btn-block">Add Product</button>
			</form>
		</c:when>

		<c:otherwise>
			<h3>No role applied</h3>
		</c:otherwise>
	</c:choose>
</p>
